package com.devframe.sysbase.model.base;

import java.io.Serializable;

import com.devframe.sysbase.model.*;


/**
 * This is an object that contains data related to the VW_SYS_MENU table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="VW_SYS_MENU"
 */

public abstract class BaseTSysMenu  implements Serializable {

	public static String REF = "TSysMenu";
	public static String PROP_SORT_NO = "sortNo";
	public static String PROP_PARENT_MENU = "parentMenu";
	public static String PROP_MENU_NAME = "menuName";
	public static String PROP_URL = "url";
	public static String PROP_ROOT_MENU = "rootMenu";
	public static String PROP_MENU_CODE = "menuCode";


	// constructors
	public BaseTSysMenu () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseTSysMenu (java.lang.String menuCode) {
		this.setMenuCode(menuCode);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.String menuCode;

	// fields
	private java.lang.String menuName;
    private java.lang.String rightCode;
	private java.lang.String url;
	private java.lang.Long sortNo;
    private java.lang.String operInfoTmpl;
	// many to one
	private TSysMenu parentMenu;
	private TSysMenu rootMenu;

	// collections
	private java.util.Set<TSysMenuFunc> funcs;
	private java.util.Set<TSysMenu> childMenus;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="uuid.hex"
     *  column="MENU_CODE"
     */
	public java.lang.String getMenuCode () {
		return menuCode;
	}

	/**
	 * Set the unique identifier of this class
	 * @param menuCode the new ID
	 */
	public void setMenuCode (java.lang.String menuCode) {
		this.menuCode = menuCode;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: MENU_NAME
	 */
	public java.lang.String getMenuName () {
		return menuName;
	}

	/**
	 * Set the value related to the column: MENU_NAME
	 * @param menuName the MENU_NAME value
	 */
	public void setMenuName (java.lang.String menuName) {
		this.menuName = menuName;
	}



	/**
	 * Return the value associated with the column: URL
	 */
	public java.lang.String getUrl () {
		return url;
	}

	/**
	 * Set the value related to the column: URL
	 * @param url the URL value
	 */
	public void setUrl (java.lang.String url) {
		this.url = url;
	}



	/**
	 * Return the value associated with the column: SORT_NO
	 */
	public java.lang.Long getSortNo () {
		return sortNo;
	}

	/**
	 * Set the value related to the column: SORT_NO
	 * @param sortNo the SORT_NO value
	 */
	public void setSortNo (java.lang.Long sortNo) {
		this.sortNo = sortNo;
	}



	/**
	 * Return the value associated with the column: PARENT_CODE
	 */
	public TSysMenu getParentMenu () {
		return parentMenu;
	}

	/**
	 * Set the value related to the column: PARENT_CODE
	 * @param parentMenu the PARENT_CODE value
	 */
	public void setParentMenu (TSysMenu parentMenu) {
		this.parentMenu = parentMenu;
	}



	/**
	 * Return the value associated with the column: ROOT_MENU
	 */
	public TSysMenu getRootMenu () {
		return rootMenu;
	}

	/**
	 * Set the value related to the column: ROOT_MENU
	 * @param rootMenu the ROOT_MENU value
	 */
	public void setRootMenu (TSysMenu rootMenu) {
		this.rootMenu = rootMenu;
	}



	/**
	 * Return the value associated with the column: funcs
	 */
	public java.util.Set<TSysMenuFunc> getFuncs () {
		return funcs;
	}

	/**
	 * Set the value related to the column: funcs
	 * @param funcs the funcs value
	 */
	public void setFuncs (java.util.Set<TSysMenuFunc> funcs) {
		this.funcs = funcs;
	}

	public void addTofuncs (TSysMenuFunc tSysMenuFunc) {
		if (null == getFuncs()) setFuncs(new java.util.TreeSet<TSysMenuFunc>());
		getFuncs().add(tSysMenuFunc);
	}



	/**
	 * Return the value associated with the column: childMenus
	 */
	public java.util.Set<TSysMenu> getChildMenus () {
		return childMenus;
	}

	/**
	 * Set the value related to the column: childMenus
	 * @param childMenus the childMenus value
	 */
	public void setChildMenus (java.util.Set<TSysMenu> childMenus) {
		this.childMenus = childMenus;
	}

	public void addTochildMenus (TSysMenu tSysMenu) {
		if (null == getChildMenus()) setChildMenus(new java.util.TreeSet<TSysMenu>());
		getChildMenus().add(tSysMenu);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof TSysMenu)) return false;
		else {
			TSysMenu tSysMenu = (TSysMenu) obj;
			if (null == this.getMenuCode() || null == tSysMenu.getMenuCode()) return false;
			else return (this.getMenuCode().equals(tSysMenu.getMenuCode()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getMenuCode()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getMenuCode().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

    public java.lang.String getOperInfoTmpl() {
        return operInfoTmpl;
    }

    public void setOperInfoTmpl(java.lang.String operInfoTmpl) {
        this.operInfoTmpl = operInfoTmpl;
    }

    public java.lang.String getRightCode() {
        return rightCode;
    }

    public void setRightCode(java.lang.String rightCode) {
        this.rightCode = rightCode;
    }


}